﻿using System;
using System.Collections.Generic;
using System.Data.Linq;
using System.Linq;
using GodProject.generators;
using GodProject.peoples;
using WebGodServer.Database;

namespace WebGodServer
{


  class Program
  {
    
    static void Main(string[] args)
    {
      DatabaseManager manager = new DatabaseManager(@"F:\\[VII]\\Губанов\\gubanov-arstan-mm-2011\\Lab6_1\\WebServices\\WebGodServer\\GodDatabase.sdf");
      IEnumerable<SearchResult> found = manager.Find(new SearchQuery()
                                 {
                                   ChildSex = SearchQuery.QuerySex.Female,
                                   ChildName = "Ан"

                                 });
      int i = 0;
      foreach (SearchResult searchResult in found)
      {
        Console.WriteLine(searchResult.ToString());
      }
    
    }

    private static void Fill()
    {
      GodPeopleGenerator generator = new GodPeopleGenerator();
      DatabaseFiller filler =
        new DatabaseFiller(
          @"F:\\[VII]\\Губанов\\gubanov-arstan-mm-2011\\Lab6_1\\WebServices\\WebGodServer\\GodDatabase.sdf");


      for (int i = 0; i < 100; i++)
      {
        Human h1 = generator.CreateHuman();
        Human h2 = generator.CreatePair(h1);

        filler.InsertPair(h1, h2);
      }
    }
  }
}
